<?php /* @var $user User */;?>
<?php use_helper('Date'); ?>
<div class="tabbed">
	<ul class="tabs">
		<li id="tab-myprofile_details" class="tab active">my profile</li>
		<li id="tab-myprofile_keywords" class="tab">more info</li>
		<li id="tab-networks" class="tab">networks</li>
	</ul>

	<div id="myprofile_details" class="content group">
		<div class="avatar">
			<?php echo image_tag($user->getThumbnailUrl(), 'alt="'.$user->getName().'"')?><br />
		</div>

		<dl class="group">
			<dt>Name:</dt>
			<dd>
				<span><?php echo $user->getName() ?>&nbsp;</span>
				<input type="text" name="name" id="profile-name" value="<?php echo $user->getName() ?>" />
			</dd>
			<dt>Age:</dt>
			<dd>
				<span><?php echo $user->getAge() == 0 ? '' : $user->getAge() ?>&nbsp;</span>
				<select name="age" id="profile-age">
					<option value="-1">Select an age</option>
					<?php for ($i=1; $i<101; $i++): ?>
					<option value="<?php echo $i?>" <?php echo $i == $user->getAge() ? 'selected="selected"' : '' ?>><?php echo $i?></option>
					<?php endfor; ?>
				</select>
			</dd>
			<dt>Gender:</dt>
			<dd>
				<span>
					<?php if ($user->getGender() == 'm'):?>
						Male
					<?php else: ?>
						Female
					<?php endif; ?>
				</span>
				<select name="gender" id="profile-gender">
					<option value="m"<?php if ($user->getGender() == 'm'):?> selected="selected"<?php endif;?>>Male</option>
					<option value="f"<?php if ($user->getGender() == 'f'):?> selected="selected"<?php endif;?>>Female</option>
				</select>
			</dd>
			<dt>Roots / origin:</dt>
			<dd>
				<span><?php echo $user->getOrigin() ?>&nbsp;</span>
				<input type="text" name="origin" id="profile-origin" value="<?php echo $user->getOrigin() ?>" />
			</dd>
			<dt>Country</dt>
			<dd>
				<?php use_helper('Form'); ?>
				<?php $countries = sfCultureInfo::getInstance($culture)->getCountries(); ?>
				<span><?php echo $user->getCountry() ?>&nbsp;</span>
				<?php echo select_country_tag('profile-country', array_search($user->getCountry(), $countries)) ?>
			</dd>
			<dt>My job /school:</dt>
			<dd>
				<span><?php echo $user->getOccupation() ?>&nbsp;</span>
				<input type="text" name="occupation" id="profile-occupation" value="<?php echo $user->getOccupation() ?>" />
			</dd>
			<dt>My favorite enemy:</dt>
			<dd>
				<span><?php echo $user->getEnemy() ?>&nbsp;</span>
				<input type="text" name="enemy" id="profile-enemy" value="<?php echo $user->getEnemy() ?>" />
			</dd>
			<dt class="showprofile">Show profile:</dt>
			<dd class="showprofile">
				<input type="checkbox" name="showprofile" id="profile-showprofile" value="1" <?php if ($user->getShowProfile() == 1): ?>checked="checked"<?php endif;?> />
				Yes, allow others to see my profile
			</dd>
			<dt class="imageurl">Profile picture:</dt>
			<dd class="imageurl">
				<input type="text" name="profile-avatar" id="profile-avatar" value="<?php echo $user->getThumbnailUrl() ?>" />
				<span>Enter the URL of the picture you want to use. It will be cropped to 75x75 pixels</span>
			</dd>
		</dl>
		
		<p class="group" style="margin:0; clear: both">
			<span class="edit-profile">Edit profile</span>
			<span class="save-profile">Save profile</span>
		</p>
	</div>

	<div id="myprofile_keywords" class="content hide">
		<h3 class="chosen">Chosen keywords<span> (click to remove)</span></h3>
		<div id="my-keywords">
			<?php if ($user->getKeywords() != ''): ?>
			<?php
				$categoryStrings = explode('#', $user->getKeywords());

				foreach ($categoryStrings as $categoryString) :
					list($category, $joinedKeywords) = explode('||', $categoryString);
					$keywords = explode('|', $joinedKeywords);
			?>
			<div>
				<h4><?php echo $category?></h4>
				<p>
					<?php for ($i=0; $i<count($keywords); $i++): ?>
					<span class="chosen-keyword"><?php echo $keywords[$i]?></span><?php if ($i<count($keywords)-1):?>, <?php endif; ?>
					<?php endfor; ?>
				</p>
			</div>	
			<?php	endforeach;	?>
			<?php else: ?>
			<p>No keywords chosen</p>
			<?php endif;?>
		</div>

		<h3>Add keywords</h3>
		<h4>Categories</h4>
		<p class="categories">
			<span class="keyword-category selected">Character</span>, <span class="keyword-category">Politics</span>,
			<span class="keyword-category">Religion</span>, <span class="keyword-category">Sex</span>,
			<span class="keyword-category">Wound</span>, <span class="keyword-category">Favourite issue</span>,
			<span class="keyword-category">Ambition</span>, <span class="keyword-category">My background</span>,
			<span class="keyword-category">Relationship</span> 
		</p>

		<h4>keywords</h4>
		<p class="category-character category">
			<span class="keyword">Addicted</span>, <span class="keyword">Ashamed</span>,
			<span class="keyword">Blunt</span>, <span class="keyword">Emotional</span>,
			<span class="keyword">Fatalistic</span>, <span class="keyword">Helpful</span>,
			<span class="keyword">Horny</span>, <span class="keyword">Loveable</span>,
			<span class="keyword">Modern</span>, <span class="keyword">Passionate</span>,
			<span class="keyword">Pessimist</span>, <span class="keyword">Provocative</span>,
			<span class="keyword">Rational</span>, <span class="keyword">Rebelious</span>,
			<span class="keyword">Sensitive</span>, <span class="keyword">Sinful</span>,
			<span class="keyword">Spiritual</span>, <span class="keyword">Traditional</span>
		</p>
		<p class="category-politics category hide">
			<span class="keyword">Capitalistic</span>, <span class="keyword">Communist</span>,
			<span class="keyword">Conservative</span>, <span class="keyword">Democratic</span>,
			<span class="keyword">Extremist</span>, <span class="keyword">Fascist</span>,
			<span class="keyword">Feminist</span>, <span class="keyword">Green</span>,
			<span class="keyword">Liberal</span>, <span class="keyword">Social</span>
		</p>
		<p class="category-religion category hide">
			<span class="keyword">Atheistic</span>, <span class="keyword">Buddhist</span>,
			<span class="keyword">Christian</span>, <span class="keyword">Confusions</span>,
			<span class="keyword">Hindu</span>, <span class="keyword">Jewish</span>,
			<span class="keyword">Muslim</span>, <span class="keyword">Orthodox</span>
		</p>
		<p class="category-sex category hide">
			<span class="keyword">Bi</span>, <span class="keyword">Celebacy</span>,
			<span class="keyword">Don't like it</span>, <span class="keyword">Gay</span>,
			<span class="keyword">Hetero</span>, <span class="keyword">Lesbian</span>,
			<span class="keyword">Like it</span>, <span class="keyword">Transsexual</span>,
			<span class="keyword">Virgin</span>
		</p>
		<p class="category-wound category hide">
			<span class="keyword">Abuse</span>, <span class="keyword">Addiction</span>,
			<span class="keyword">Body</span>, <span class="keyword">Censorship</span>,
			<span class="keyword">Confession</span>, <span class="keyword">Death</span>,
			<span class="keyword">Divorce</span>, <span class="keyword">Drugs</span>,
			<span class="keyword">Fear</span>, <span class="keyword">Feeling</span>,
			<span class="keyword">lost</span>, <span class="keyword">Fight</span>,
			<span class="keyword">Friends</span>, <span class="keyword">Handicap</span>,
			<span class="keyword">Hate</span>, <span class="keyword">History</span>,
			<span class="keyword">Insults</span>, <span class="keyword">Lies</span>,
			<span class="keyword">Loss</span>, <span class="keyword">Pain</span>,
			<span class="keyword">Rape</span>, <span class="keyword">Scars</span>,
			<span class="keyword">Skin</span>, <span class="keyword">Terrorism</span>,
			<span class="keyword">Treason</span>, <span class="keyword">Truth</span>,
			<span class="keyword">Violence</span>, <span class="keyword">War</span>
		</p>
		<p class="category-favourite-issue category hide">
			<span class="keyword">Animal rights</span>, <span class="keyword">Art</span>,
			<span class="keyword">Art and culture</span>, <span class="keyword">Authorities</span>,
			<span class="keyword">Battle</span>, <span class="keyword">Books</span>,
			<span class="keyword">Brands</span>, <span class="keyword">Cartoons</span>,
			<span class="keyword">Censorship</span>, <span class="keyword">Dictatorship</span>,
			<span class="keyword">Dresscodes</span>, <span class="keyword">Drugs</span>,
			<span class="keyword">Education</span>, <span class="keyword">Education and developement</span>,
			<span class="keyword">Enemy</span>, <span class="keyword">Environment</span>,
			<span class="keyword">European Union</span>, <span class="keyword">Family/marriage/honour</span>,
			<span class="keyword">Fashion</span>, <span class="keyword">Food</span>,
			<span class="keyword">Freedom of speech</span>, <span class="keyword">Gay movement</span>,
			<span class="keyword">Globalisation</span>, <span class="keyword">Health</span>,
			<span class="keyword">History</span>, <span class="keyword">Immigration/integration</span>,
			<span class="keyword">International development</span>, <span class="keyword">Israel/Palestine</span>,
			<span class="keyword">Law</span>, <span class="keyword">Leaders in Africa</span>,
			<span class="keyword">Leadership</span>, <span class="keyword">Love</span>,
			<span class="keyword">Marriage</span>, <span class="keyword">Media</span>,
			<span class="keyword">Middle East</span>, <span class="keyword">Migration</span>,
			<span class="keyword">Movies</span>, <span class="keyword">Music</span>,
			<span class="keyword">Politics</span>, <span class="keyword">Religion</span>,
			<span class="keyword">Roots</span>, <span class="keyword">School</span>,
			<span class="keyword">Science/technology</span>, <span class="keyword">Sex</span>,
			<span class="keyword">Sport</span>, <span class="keyword">Terrorism</span>,
			<span class="keyword">The Media</span>, <span class="keyword">The West</span>,
			<span class="keyword">Travel</span>, <span class="keyword">War</span>,
			<span class="keyword">Words</span>
		</p>
		<p class="category-ambition category hide">
			<span class="keyword">Career Opportunity</span>, <span class="keyword">Destroy the world</span>,
			<span class="keyword">Familylife</span>, <span class="keyword">Freedom</span>,
			<span class="keyword">Freedom of speech</span>, <span class="keyword">Friendship</span>,
			<span class="keyword">Future</span>, <span class="keyword">Get famous</span>,
			<span class="keyword">Get rich</span>, <span class="keyword">Intimacy</span>,
			<span class="keyword">Leadership</span>, <span class="keyword">Love</span>,
			<span class="keyword">Migration</span>, <span class="keyword">Money</span>,
			<span class="keyword">My dream</span>, <span class="keyword">Passion</span>,
			<span class="keyword">Peace</span>, <span class="keyword">Power</span>,
			<span class="keyword">Pregnant</span>, <span class="keyword">Rights</span>,
			<span class="keyword">Save the world</span>, <span class="keyword">Worldpeace</span>
		</p>
		<p class="category-my-background category hide">
			<span class="keyword">Addiction</span>, <span class="keyword">Alone</span>,
			<span class="keyword">Angry</span>, <span class="keyword">Arab</span>,
			<span class="keyword">Arabic</span>, <span class="keyword">Beauty</span>,
			<span class="keyword">Body</span>, <span class="keyword">Chinese</span>,
			<span class="keyword">Colour</span>, <span class="keyword">Coloured</span>,
			<span class="keyword">Confession</span>, <span class="keyword">Extreme</span>,
			<span class="keyword">Family</span>, <span class="keyword">Fashion</span>,
			<span class="keyword">Guilt</span>, <span class="keyword">Hair</span>,
			<span class="keyword">Honour</span>, <span class="keyword">Humor</span>,
			<span class="keyword">Humour</span>, <span class="keyword">Identity</span>,
			<span class="keyword">Illegal</span>, <span class="keyword">Intimate</span>,
			<span class="keyword">Man</span>, <span class="keyword">Me</span>,
			<span class="keyword">Mixed</span>, <span class="keyword">My culture</span>,
			<span class="keyword">Opposition</span>, <span class="keyword">Pregnant</span>,
			<span class="keyword">Rebel</span>, <span class="keyword">Secret</span>,
			<span class="keyword">Sin</span>, <span class="keyword">Street</span>,
			<span class="keyword">Woman</span>
		</p>
		<p class="category-relationship category hide">
			<span class="keyword">Divorced</span>,
			<span class="keyword">Engaged</span>,
			<span class="keyword">In love </span>,
			<span class="keyword">Mariag</span>,
			<span class="keyword">Single</span>
		</p>

		<span class="edit-profile">Edit profile</span>
		<span class="save-profile">Save profile</span>
	</div>

	<div id="networks" class="content group hide">
		<h3>Current networks</h3>
		<?php if($networks = $user->getNetworks()): ?>
			<p><?php echo join(",",$networks) ?></p>
		<?php else: ?>
		None.
		<?php endif; ?>

		<h3>Add a network</h3>
		<ol>
			<li>
				<span class="generate-code">Generate a code</span>: <input type="text" class="connect-code" />
			</li>
			<li>
				Install the widget on the social network of your choice and for which the widget is available<br />
				available networks: <?php include_partial('global/socialnetworkselector') ?>
				<span class="go-to-network">go there</span>
			</li>
			<li>Select "already registered" and fill in the code</li>
		</ol>
	</div>
</div>